from fastapi import APIRouter, Request, Depends
from fastapi.responses import HTMLResponse

from applications.common.render_template import templates
from applications.common.user_manager import manager
from applications.models import User

route = APIRouter(include_in_schema=False)


# 首页
@route.get("/", name="index.index", response_class=HTMLResponse, include_in_schema=False)
def index(request: Request, user: User = Depends(manager)):
    return templates.TemplateResponse("system/index.html", {"request": request, "user": user})
